Skip to content

feat(mcp): let agents change thread workspaces - #8680

Closed
juliusmarminge wants to merge 19 commits into
agents/mcp-workspaces/inventoryfrom
agents/mcp-workspaces/checkout
Closed

feat(mcp): let agents change thread workspaces#8680
juliusmarminge wants to merge 19 commits into
agents/mcp-workspaces/inventoryfrom
agents/mcp-workspaces/checkout

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Aug 29, 2026

Copy link
Copy Markdown
Member

Agents need a safe way to move an existing thread to a branch, project root, existing checkout, or new worktree while keeping durable thread metadata aligned with actual Git state.

This dependent layer adds t3_thread_checkout over the existing VCS, V2 command, provider-session, and continuation workflows. It verifies requested refs, canonical repository/worktree identity, dirty state, active and shared ownership, and the final checked-out state before committing the binding. Physical workspace admission covers aliases and nested project roots. New-worktree handoff rechecks ownership after creation and retains any checkout whose cleanup ownership becomes uncertain.

Pre-mutation reads remain cancellable. Once mutation starts, the narrow Git/binding/rollback section preserves atomicity and truthful partial-failure outcomes. A successful move ends the current provider turn; continuationPrompt schedules the replacement turn in the selected workspace. Status broadcasting is refreshed after committed changes without allowing refresh failure to rewrite the completed result.

Focused validation:

  • 314 tests across the combined inventory/checkout stack, including real Git ref handling, cancellation, concurrent ownership, rollback retention, provider detach/continuation, contracts, registration, and presentation
  • vp run --filter t3 typecheck
  • vp run --filter @t3tools/contracts typecheck
  • vp run --filter @t3tools/shared typecheck
  • vp run --filter @t3tools/client-runtime typecheck
  • Targeted vp lint, vp fmt --check, and git diff --check

Depends on #8685 for canonical bounded workspace discovery. Native stack: #8685#8680, rooted on t3code/codex-turn-mapping at 415ed0f73b97f1655b6282492f81d0b2bba3a9cc.

Implemented by GPT-5.6-Sol via Codex in T3 Code.

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a2fe674c-aa02-4f15-950f-20e9f297b529

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Warning

Your free Security trial is over. An organization admin can activate Security or dismiss this notice.


Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Aug 29, 2026
@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 84f260d.

This comment will update automatically after the next completed run.

Comment thread apps/server/src/mcp/WorktreeMcpService.ts Outdated
Comment thread apps/server/src/mcp/WorktreeMcpService.ts Outdated
Comment thread apps/server/src/mcp/WorktreeMcpService.ts Outdated
@juliusmarminge
juliusmarminge changed the base branch from t3code/codex-turn-mapping to agents/mcp-workspaces/inventory August 29, 2026 21:55
Comment thread docs/orchestration-v2/orchestrator-mcp-server.md
Comment thread docs/user/source-control.md Outdated
@juliusmarminge
juliusmarminge marked this pull request as ready for review August 29, 2026 22:44
Comment thread apps/server/src/mcp/WorktreeMcpService.ts Outdated
Comment thread apps/server/src/mcp/WorktreeMcpService.ts
@macroscopeapp

macroscopeapp Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds an agent-facing checkout workflow and changes existing handoff behavior across Git mutation, durable thread bindings, ownership arbitration, rollback, and provider-session detachment. The breadth and side effects of these production changes warrant human review.

No code changes detected at 84f260d. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

Comment thread apps/server/src/mcp/WorktreeMcpService.ts
Comment thread apps/server/src/mcp/WorktreeMcpService.ts
Comment thread apps/server/src/mcp/WorktreeMcpService.ts Outdated
Comment thread apps/server/src/mcp/WorktreeMcpService.ts
Comment thread apps/server/src/mcp/WorktreeMcpService.ts
Comment thread apps/server/src/mcp/WorktreeMcpService.ts
Comment thread apps/server/src/mcp/WorktreeMcpService.ts
Comment thread apps/server/src/mcp/WorktreeMcpService.ts
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-workspaces/checkout branch from 03d0e2b to 4453207 Compare August 30, 2026 17:29
Comment thread docs/orchestration-v2/orchestrator-mcp-server.md Outdated
Comment thread apps/server/src/mcp/WorktreeMcpService.ts
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-workspaces/checkout branch from 4453207 to 1d54579 Compare August 30, 2026 18:10
Comment thread docs/orchestration-v2/orchestrator-mcp-server.md Outdated
Comment thread apps/server/src/mcp/WorktreeMcpService.ts
Comment thread apps/server/src/mcp/WorktreeMcpService.ts
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-workspaces/checkout branch from 76ccdb2 to 69afd25 Compare August 30, 2026 18:41
Comment thread docs/user/source-control.md Outdated
Comment thread apps/server/src/mcp/WorktreeMcpService.ts Outdated
Comment thread apps/server/src/mcp/WorktreeMcpService.ts

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Effect service conventions review of the new WorktreeMcpService.checkout path: service tag, inline interface, make/layer, subpath namespace imports, dependency acquisition (yield* Foo.Foo), and error construction all follow the conventions. One test-organization issue noted inline.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/mcp/WorktreeMcpService.test.ts Outdated
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-workspaces/checkout branch from 1ed8ca4 to d653ad1 Compare August 30, 2026 20:14
Comment thread apps/server/src/mcp/WorktreeMcpService.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but a cloud agent failed to start.

Reviewed by Cursor Bugbot for commit d653ad1. Configure here.

Comment thread apps/server/src/mcp/WorktreeMcpService.ts
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-workspaces/checkout branch from 0e3839f to e7221b8 Compare September 5, 2026 06:10
Comment thread apps/server/src/mcp/WorktreeMcpService.ts
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-workspaces/checkout branch from e7221b8 to 4838416 Compare September 5, 2026 06:34
@juliusmarminge

Copy link
Copy Markdown
Member Author

Superseded as the active MCP proposal by #10566 in the rebuilt MCP stack, following the maintainer request to review thin service wrappers separately from service hardening.

This is not a full feature-parity replacement. This discovers branch-backed refs/worktrees only. Detached unbound inventory and switching an existing checkout require a shared service operation and are intentionally not rebuilt inside MCP. The old workspace work is retained for that extraction.

Closing this mixed proposal without merging. The remote branch agents/mcp-workspaces/checkout and exact head 84f260db922bef1a7b54624c2e2f9bc6805f8094 are retained so the service changes can be extracted for separate review later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant